package com.example.dto;

import com.example.dto.base.BaseDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @Description: DemoDTO入参
 * @Auther: Swain
 * @Date: 2021/1/11 16:48
 * @Version 1.0.0
 */
@Data
@ApiModel("DemoDTO入参")
public class DemoDTO extends BaseDTO {

    private Long id;

    @NotBlank(message = "业务id不能为空", groups = {delete.class,update.class,findSingle.class})
    @ApiModelProperty("业务id")
    private String demoId;

    @NotBlank(message = "业务描述不能为空", groups = {add.class,update.class})
    @ApiModelProperty("业务描述")
    private String demoDesc;

    @ApiModelProperty("创建人")
    private String createBy;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("更新人")
    private String updateBy;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ApiModelProperty("更新时间")
    private Date updateTime;

    @ApiModelProperty("版本")
    @NotNull(message = "版本不能为空", groups = {update.class})
    private Long version;

    /**
     * 增
     */
    public interface add {

    }

    /**
     * 删
     */
    public interface delete {

    }

    /**
     * 改
     */
    public interface update {

    }

    /**
     * 查
     */
    public interface findSingle {

    }
}
